package youxiao.bytezon.views.commons;

import org.springframework.data.domain.Page;

public class PageInfo {

	private long pageNum;
	private long pagesCount;
	private long pageRecordsCount;
	private long totalRecordsCount;
	
	public PageInfo(Page<?> pagination) {
		this.pageNum = pagination.getNumber() + 1;
		this.pagesCount = pagination.getTotalPages();
		this.pageRecordsCount = pagination.getNumberOfElements();
		this.totalRecordsCount = pagination.getTotalElements();
	}

	public long getPageNum() {
		return pageNum;
	}

	public void setPageNum(long pageNum) {
		this.pageNum = pageNum;
	}

	public long getPagesCount() {
		return pagesCount;
	}

	public void setPagesCount(long pagesCount) {
		this.pagesCount = pagesCount;
	}

	public long getPageRecordsCount() {
		return pageRecordsCount;
	}

	public void setPageRecordsCount(long pageRecordsCount) {
		this.pageRecordsCount = pageRecordsCount;
	}

	public long getTotalRecordsCount() {
		return totalRecordsCount;
	}

	public void setTotalRecordsCount(long totalRecordsCount) {
		this.totalRecordsCount = totalRecordsCount;
	}

	
}
